package net.zjitc.mystring;

/**
 * Created by Administrator on 2017/4/13.
 */
public class IStringimpl implements IString{
    String string=new String("abcdfgjwueqwe");
    String string1=new String("hjashdjksand");
    StringBuffer sb=new StringBuffer(string);
    //求串长度
    @Override
    public int length() {
        return string.length();
    }
    //串连接
    @Override
    public String concat(String str) {
        str=string.concat(str);
        return str ;
    }
    //串比较
    @Override
    public int conpereTo(String str) {
        return string.compareTo(str);
    }
    //求子串
    @Override
    public String substring(int start, int end) {

        return string.substring(start,end);
    }
    //串定位
    @Override
    public int indexOf(String str, int fromIndex) {

        return string.indexOf(str,fromIndex);
    }
    //串插入
    @Override
    public StringBuffer inser(int offset, String str) {
        return sb.insert(offset,str);
    }
    //串删除
    @Override
    public StringBuffer delete(int start, int end) {
        return sb.delete(start,end);
    }
}
